<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../jquery-1.7.2.js"></script>
</head>
<body>
<script>
$(function(){
    function sum() {
        var fir = arguments[0];
        if(arguments.length === 2) {
            return arguments[0] + arguments[1]
        } else {
            return function(sec) {
                return fir + sec;
            }
        }

    }
    console.log(sum(2,3));   // Outputs 5
    console.log(sum(2)(3));  // Outputs 5
//    用arguments的方法调用两个参数
})
</script>
</body>
</html>